
from Po.PoDemo.Page import Page
import  unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
import time


class TestCase(unittest.TestCase):

    def setUp(self):

        self.driver = webdriver.Chrome()
        self.driver.maximize_window()

    def tearDown(self):
        self.driver.quit()

    def test_luoji(self):
        po=Page(self.driver)
        po.open_url('http://localhost:8080/loging')
        time.sleep(2)
        po.zhanghao()
        time.sleep(2)
        po.mima()
        time.sleep(2)
        duanyan1=self.driver.find_element(By.XPATH,'/html/body/div[1]/div/section/section/main/div/div[2]/div[3]/label[1]/span[2]').text
        self.assertEqual(duanyan1, '保持登录')
        time.sleep(2)
        po.denglu()
        time.sleep(2)


if __name__ == '__main__':
    unittest.main()
